package action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import annotation.controllerAnnotation;
import annotation.forwardAnnotation;
import form.ActionForm;
import form.testForm;

@controllerAnnotation(path="/testAction",formClass="form.testForm",

forward={@forwardAnnotation(name="cg",url="/view/cg.jsp"),@forwardAnnotation(name="er",url="/view/er.jsp")})

public class testAction implements Action {

	@Override
	public String execute(HttpServletRequest request, HttpServletResponse response, ActionForm form,
			Map<String, String> ActionForward) {
		// TODO Auto-generated method stub
		String url ="er";
		String forwardUrl =null;
		forwardUrl = ActionForward.get(url);
		testForm tform = (testForm) form;
		if(tform.getName().equals("wlg")){
			url ="cg";
			forwardUrl = ActionForward.get(url);
			
		}
		return forwardUrl;
	}

}
